﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;

namespace RevClinic.Core.Security
{
    public class Sha1Encrypter : IEncrypter
    {
        public string Encode(string plain)
        {
            ASCIIEncoding encoder = new ASCIIEncoding();
            SHA1Managed hasher = new SHA1Managed();

            byte[] bytePassword = encoder.GetBytes(plain);
            byte[] hash = hasher.ComputeHash(bytePassword);

            return encoder.GetString(hash);

        }
    }
}
